<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue.js学习</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>   <!--引入vue.js-->
</head>
<body>
    <div id="hehe">
        <p>您最喜欢的编程语言是：{{language}}</p>
        <button v-on:click="btnClick('PHP')">PHP</button>
        <button v-on:click="btnClick('JAVA')">JAVA</button>
        <button @click="btnClick('GOLANG')">GOLANG</button>
        <button @click="btnClick('PYTHON')">PYTHON</button>
    </div>
    <script>
        var xue = new Vue({
            el: '#hehe',
            data: {
                language: 'JAVA'
            },
            methods: {
                btnClick: function(pname){
                    this.language = pname;
                },
            },
        });
    </script>
</body>
</html>